<template>
    <div id="app" v-cloak>
        <div class="content-header">

<h1>反馈管理</h1>
<br />
<!--用户管理按钮-->
<el-button @click="Manage" type="success"  style="width: 30%;font-size: 20px;" plain>
        去用户管理
    </el-button>
<!--公告按钮-->
<el-button @click="Bulletin" type="success" style="width:30%;font-size: 20px;" plain>
      去发布公告
    </el-button>
    <!--用户反馈按钮-->
    <el-button @click="Help" type="info" style="width: 30%;font-size: 20px;" >
        去用户反馈
    </el-button>
    
</div>

<div class="app-container">

<div class="box">

    <el-table size="small" current-row-key="id" :data="dataList" stripe highlight-current-row>

        <el-table-column type="index" align="center" label="序号"></el-table-column>

        <el-table-column prop="uid" label="账号" align="center"></el-table-column>

        <el-table-column prop="fkphone" label="联系方式" align="center"></el-table-column>
        
        <el-table-column prop="fktext" label="反馈内容" align="center"></el-table-column>

        <el-table-column prop="date" label="反馈时间" align="center"></el-table-column>

        <el-table-column label="操作" align="center">

            <template slot-scope="scope">

                <el-button type="danger" size="mini" @click="handleDelete(scope.row)">删除</el-button>

            </template>

        </el-table-column>

    </el-table>


</div>
    
</div>
    </div>
  </template>

<script>
  export default {
    components: {
      
    },
    data(){
        return {
            dataList: [],//当前页要展示的列表数据
            dialogFormVisible: false,//添加表单是否可见
            formData: {},//表单数据
            uid:"",
        }
    },
    created() {
            //调用查询全部数据的操作
            this.getAll();
        },

    methods: {
            getAll(){
                this.$axios({
                        url:"http://localhost/help",
                        method:"get",
                        data:{
                        },
                    })
                        .then((res)=>{
                            this.dataList = res.data.data;
                        })
            },


            //重置表单
            resetForm() {
                this.formData = [];
            },


            // 删除
            handleDelete(row) {
                    this.$confirm("此操作永久删除当前信息，是否继续？","提示",{type:"info"}).then(()=>{
                                this.$axios({
                                url:"http://localhost/help/"+row.id,
                                method:"delete",
                                data:{

                                },
                            }).then((res)=>{
                                if(res.data.flag){
                                this.$message.success("删除成功");
                                this.getAll();
                                }
                                else{
                                    this.$message.error("数据同步失败，自动刷新！");
                                    this.getAll();
                                }
                            })
                            }).catch(()=>{
                        });
            },

            //跳转用户管理
            Manage(){
                this.$router.push({ path: '/Manage/' +"123"})
            },
            Bulletin(){
                this.$router.push({ path: '/Bulletin/'+"123"})
            },
        }
  }
  </script>
<style src="@/css/style.css"></style> 
<style scoped>
[v-cloak]{
  display:none;
}
#app{
    height:100vh;
}
</style>